#!/bin/bash
pattern=$*
echo "Killing all processes that match on pattern: $pattern"
echo "Kill pid(s): `ps aux | egrep "$pattern" | tr -s " " | cut -d ' ' -f2 | head -n 2 | tr '\n' ' '`"
kill -INT `ps aux | egrep "$pattern" | tr -s " " | cut -d ' ' -f2 | tr '\n' ' '`

